<h2>Gestion de la FAQ</h2>

<div class="button-box">
	<?= button_link('admin/faqs/new_faq', 'Nouvelle question', 'add') ?>
	<?= button_link('admin/faqs/sort', 'Changer l\'ordre', 'arrow_switch') ?>
</div>
<table class="dataTable">
	<thead>
		<tr>
			<th>Question</th>
			<th>Position</th>
			<th>Créé le</th>
			<th>Publié</th>
			<th>Actions</th>
		</tr>
	</thead>
	<tbody>
		<?php foreach ($faqs as $faq) { ?>
			<tr id="faq_<?= $faq->id ?>">
				<td>
					<?= $faq->question ?>
				</td>
				<td class="center"><?= $faq->position ?></td>
				<td><?= time_to_str($faq->created_at) ?></td>
				<td class="center"><?= bool_icon($faq->online) ?></td>
				<td class="actions">
					<?= details_link($faq, 'faq_details') ?>
					<?= edit_link($faq, 'faqs/edit') ?>
					<?= delete_link($faq, 'faq_delete') ?>
				</td>
			</tr>
		<?php } ?>
	</tbody>
</table>
